﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;

public partial class Ingresos : System.Web.UI.Page
{

    protected void Page_Load(object sender, EventArgs e)
    
    {

        change();  
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        
    }




    protected void GridView1_RowDeleting1(object sender, GridViewDeleteEventArgs e)
    {
        e.Cancel=true;
    }
    protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        
    }
    protected void SqlDataSource2_Selecting(object sender, SqlDataSourceSelectingEventArgs e)
    {

    }
    protected void Button1_Click1(object sender, EventArgs e)
    {
       
    }
    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {
        change();
    }
    public void change()
    {
        /*string cmd = null;
        if (DropDownList1.SelectedIndex == 0)
        {
            cmd = "Select * From [Ingresos-Egresos]";
        }
        else
            cmd = "SELECT Programa, Ingresos, Egresos, Fecha, Total FROM [Ingresos-Egresos] WHERE  (YEAR(Fecha) ='" + DropDownList1.SelectedItem.ToString() + "')";
        try
        {
            SqlConnection SQL_Connection = new SqlConnection(@"Data Source=NELSON-HP\SQLEXPRESS;Initial Catalog=Ingresos;Integrated Security=True;Pooling=False");
            SqlDataAdapter da = new SqlDataAdapter(cmd, SQL_Connection);
            DataTable dataTable = new DataTable();
            SQL_Connection.Open();
            int recordsAffected = da.Fill(dataTable);

            GridView1.DataSource = dataTable;
            GridView1.DataSourceID = String.Empty;
            GridView1.DataBind();
            Chart1.DataSource = GridView1.DataSource;
            Chart1.DataSourceID = String.Empty;
            Chart1.DataBind();

        }
        catch (Exception)
        {
        }

 */
    }
    
    protected void Button2_Click(object sender, EventArgs e)
    {
        Response.Redirect("Detallle.aspx");    
    }
    protected void Calendar1_SelectionChanged(object sender, EventArgs e)
    {
    }
    protected void Button3_Click(object sender, EventArgs e)
    {
        Response.Redirect("Nuevo.aspx");
    }
    protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
     //   GridView1.PageIndex = e.NewPageIndex;
    }
    protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
    {
        e.Cancel=true;
        Response.Redirect("Detallle.aspx");
    }
    protected void Button6_Click(object sender, EventArgs e)
    {

    }
}